package com.itheima.advance.reflect.demo02;

import java.lang.reflect.Constructor;

public class ReflectDemo01 {

    public static void main(String[] args) throws ClassNotFoundException, NoSuchMethodException {

        Class<?> studentClass = Class.forName("com.itheima.advance.reflect.demo02.Student");

        Constructor<?>[] constructors = studentClass.getConstructors();
        for (Constructor constructor : constructors){
            System.out.println(constructor);
        }

        Constructor<?>[] declaredConstructors = studentClass.getDeclaredConstructors();
        for (Constructor constructor : declaredConstructors){
            System.out.println(constructor);
        }

        Constructor<?> constructor = studentClass.getConstructor();
        System.out.println(constructor);

        Constructor<?> declaredConstructor = studentClass.getDeclaredConstructor(String.class);
        System.out.println(declaredConstructor);
    }
}
